<body class="global-font-family color-primary-font-color">
	<div id='alert-anchor'></div>
</body>

<template name="main">
	{{#if subsReady}}
		{{#unless showSetupWizard}}
			{{#unless logged}}
				<div class="rc-old connection-status">
					{{> status}}
				</div>
				{{#if useIframe}}
					{{#if iframeUrl}}
						<iframe src="{{iframeUrl}}" style="height: 100%; width: 100%;"></iframe>
					{{/if}}
				{{else}}
					{{> loginLayout center="loginForm"}}
				{{/if}}
				{{ CustomScriptLoggedOut }}
			{{else}}
				{{#unless hasUsername}}
					{{> username}}
				{{else}}
					{{#if requirePasswordChange}}
						{{> loginLayout center="resetPassword"}}
					{{else}}
						{{#if require2faSetup}}
							<main id="rocket-chat" class="{{embeddedVersion}}">
								 <div class="rc-old main-content content-background-color">
									{{> Template.dynamic template="accountSecurity"}}
								</div>
							</main>
						{{else}}
							{{> videoCall overlay=true}}
							<div id="user-card-popover"></div>
							<div id="rocket-chat" class="{{embeddedVersion}} menu-nav">
								{{#unless removeSidenav}}
									{{> sideNav }}
								{{/unless}}
								<div class="{{#unless $eq old false}}rc-old{{/unless}} main-content content-background-color {{readReceiptsEnabled}}">
									{{> Template.dynamic template=center}}
								</div>
							</div>

							<div class="rc-old connection-status">
								{{> status}}
							</div>
							{{> audioNotification }}
						{{/if}}
					{{/if}}
				{{/unless}}
				{{ CustomScriptLoggedIn }}
				{{> photoswipe}}
			{{/unless}}
		{{/unless}}
	{{else}}
		{{> loading}}
	{{/if}}
</template>
